<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>

    <input type="text" placeholder="半径" id="a">
    <input type="text" placeholder="周长" id="b">
    <input type="text" placeholder="面积" id="c">

    <script>

        var a=prompt("请输入园的半径")
        a=parseFloat(a) && Number(a);

        if (!isNaN(a)){
            var c=Math.PI*a*a;
            var b=2*Math.PI*a;

            document.getElementById('a').value=a;
            document.getElementById('b').value=b.toFixed(2);
            document.getElementById('c').value=c.toFixed(2);
        }else {
            alert("请输入正确数字")
        }


        /*document.querySelector("#a").value =this;
        document.querySelector("#b").value =2;
        document.querySelector("#c").value =3;*/

    </script>

</body>
</html>